﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administrator/Admincp.Master" AutoEventWireup="true" CodeBehind="ThongtinAdmin.aspx.cs" Inherits="Moving03.Administrator.WebForm3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    CHI TIẾT
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <form id="form1" runat="server">
    <br />
    &nbsp;&nbsp;&nbsp; <strong style="color: #6666FF">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    THÔNG TIN ADMIN</strong><br />
&nbsp;<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" style="margin:auto; text-align:center"
        DataSourceID="SqlDataSource1" Width="96%" 
        onrowcommand="GridView1_RowCommand" 
        onrowdatabound="GridView1_RowDataBound" CellPadding="4" 
        ForeColor="#333333" GridLines="None">
      
        <AlternatingRowStyle BackColor="White" />
      
        <Columns>

         <asp:buttonfield buttontype="Link" 
                  commandname="sua" ImageUrl="~/images/edit.gif" HeaderImageUrl="~/images/edit.gif"
                  text="Edit"/>
    
          <asp:TemplateField HeaderText ="User_name">   
            <ItemTemplate> 
                <asp:label ID='b' runat ="server" Text='<%# Eval("UserName") %>'>
                </asp:label> 
            </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="HoTen" HeaderText="Tên Người dùng" SortExpression="HoTen"/>
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:BoundField DataField="ThanhPho" HeaderText="Thành Phố" 
                SortExpression="ThanhPho" />
              <asp:TemplateField HeaderText="Loại ND">
            
            <ItemTemplate> 
                <asp:DropDownList ID='a' runat ="server" DataTextField ="RoleName" DataValueField ="RoleId" DataSourceID ="SqlDataSource2" AutoPostBack="false" SelectedValue='<%# Eval("RoleId") %>'> 
                </asp:DropDownList> 
                
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="DienThoai" HeaderText="Điện thoại" 
                SortExpression="DienThoai" />
            <asp:BoundField DataField="TenQuocGia" HeaderText="Tên Quốc Gia" 
                SortExpression="TenQuocGia" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:UPSConnectionString %>" 
        
        SelectCommand="SELECT aspnet_Users.UserName, aspnet_Users.HoTen, aspnet_Users.Email, aspnet_Users.ThanhPho, aspnet_Users.DienThoai, aspnet_Roles.RoleName, DanhSachQuocGia.TenQuocGia, aspnet_Roles.RoleId FROM aspnet_Roles INNER JOIN aspnet_UsersInRoles ON aspnet_Roles.RoleId = aspnet_UsersInRoles.RoleId INNER JOIN aspnet_Users ON aspnet_UsersInRoles.UserId = aspnet_Users.UserId INNER JOIN DanhSachQuocGia ON aspnet_Users.QuocGia = DanhSachQuocGia.Id_MaQGia WHERE (aspnet_Roles.RoleName = 'Admin')">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:UPSConnectionString %>" 
        SelectCommand="SELECT [RoleId], [RoleName] FROM [vw_aspnet_Roles]">
    </asp:SqlDataSource>
    <p style="margin-left: 40px">
        <br />
&nbsp; <strong style="color: #6666FF">THÔNG TIN NGƯỜI DÙNG</strong><br />
        <br />
    </p>
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        Width="96%" style="margin:auto; text-align:center"
        DataSourceID="SqlDataSource3" onrowcommand="GridView2_RowCommand" 
        CellPadding="4" ForeColor="#333333" GridLines="None">
        
        <AlternatingRowStyle BackColor="White" />
        <Columns>
         <asp:buttonfield buttontype="Link" 
                  commandname="sua" ImageUrl="~/images/edit.gif" HeaderImageUrl="~/images/edit.gif"
                  text="Edit"/>
                   <asp:buttonfield buttontype="Link" 
                  commandname="xoa" ImageUrl="~/images/delete.gif" HeaderImageUrl="~/images/delete.gif"
                  text="Delete"/>
          <asp:TemplateField HeaderText ="User_name">   
            <ItemTemplate> 
                <asp:label ID='b' runat ="server" Text='<%# Eval("UserName") %>' >
                </asp:label> 
            </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="HoTen" HeaderText="Tên Người dùng" SortExpression="HoTen"/>
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:BoundField DataField="ThanhPho" HeaderText="Thành Phố" 
                SortExpression="ThanhPho" />
              <asp:TemplateField HeaderText="Loại ND">
            
            <ItemTemplate> 
                <asp:DropDownList ID='a' runat ="server" DataTextField ="RoleName" DataValueField ="RoleId" DataSourceID ="SqlDataSource2" AutoPostBack="false" SelectedValue='<%# Eval("RoleId") %>'> 
                </asp:DropDownList> 
                
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="DienThoai" HeaderText="Điện thoại" 
                SortExpression="DienThoai" />
            <asp:BoundField DataField="TenQuocGia" HeaderText="Tên Quốc Gia" 
                SortExpression="TenQuocGia" />
        </Columns>
        
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
        
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:UPSConnectionString %>" 
        
        SelectCommand="SELECT aspnet_Users.UserName, aspnet_Users.HoTen, aspnet_Users.Email, aspnet_Users.ThanhPho, aspnet_Users.DienThoai, aspnet_Roles.RoleName, DanhSachQuocGia.TenQuocGia, aspnet_Roles.RoleId FROM aspnet_Roles INNER JOIN aspnet_UsersInRoles ON aspnet_Roles.RoleId = aspnet_UsersInRoles.RoleId INNER JOIN aspnet_Users ON aspnet_UsersInRoles.UserId = aspnet_Users.UserId INNER JOIN DanhSachQuocGia ON aspnet_Users.QuocGia = DanhSachQuocGia.Id_MaQGia WHERE (aspnet_Roles.RoleName = 'Member')">
    </asp:SqlDataSource>
    <br />
    <br />
    <p style="margin-left: 40px">
        <strong style="color: #6666FF">THÔNG TIN ĐỐI TÁC SỬ DỤNG WEB SERVICE</strong><br />
        <br />
    </p>
    <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
        Width="96%" style="margin:auto; text-align:center"
        DataSourceID="SqlDataSource4" 
        CellPadding="4" ForeColor="#333333" GridLines="None" 
        onrowcommand="GridView3_RowCommand">
        
        <AlternatingRowStyle BackColor="White" />
        <Columns>
         <asp:buttonfield buttontype="Link" 
                  commandname="sua" ImageUrl="~/images/edit.gif" HeaderImageUrl="~/images/edit.gif"
                  text="Edit"/>
                   <asp:buttonfield buttontype="Link" 
                  commandname="xoa" ImageUrl="~/images/delete.gif" HeaderImageUrl="~/images/delete.gif"
                  text="Delete"/>
          <asp:TemplateField HeaderText ="User_name">   
            <ItemTemplate> 
                <asp:label ID='b' runat ="server" Text='<%# Eval("UserName") %>' >
                </asp:label> 
            </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="HoTen" HeaderText="Tên Người dùng" SortExpression="HoTen"/>
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:BoundField DataField="ThanhPho" HeaderText="Thành Phố" 
                SortExpression="ThanhPho" />
              <asp:TemplateField HeaderText="Loại ND">
            
            <ItemTemplate> 
                <asp:DropDownList ID='a' runat ="server" DataTextField ="RoleName" 
                    DataValueField ="RoleId" DataSourceID ="SqlDataSource2" AutoPostBack="false" 
                    SelectedValue='<%# Eval("RoleId") %>'> 
                </asp:DropDownList> 
                
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="DienThoai" HeaderText="Điện thoại" 
                SortExpression="DienThoai" />
            <asp:BoundField DataField="TenQuocGia" HeaderText="Tên Quốc Gia" 
                SortExpression="TenQuocGia" />
        </Columns>
        
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
        
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
        ConnectionString="<%$ ConnectionStrings:UPSConnectionString %>" 
        
        
        SelectCommand="SELECT aspnet_Users.UserName, aspnet_Users.HoTen, aspnet_Users.Email, aspnet_Users.ThanhPho, aspnet_Users.DienThoai, aspnet_Roles.RoleName, DanhSachQuocGia.TenQuocGia, aspnet_Roles.RoleId FROM aspnet_Roles INNER JOIN aspnet_UsersInRoles ON aspnet_Roles.RoleId = aspnet_UsersInRoles.RoleId INNER JOIN aspnet_Users ON aspnet_UsersInRoles.UserId = aspnet_Users.UserId INNER JOIN DanhSachQuocGia ON aspnet_Users.QuocGia = DanhSachQuocGia.Id_MaQGia WHERE (aspnet_Roles.RoleName = 'User_WebService')">
    </asp:SqlDataSource>
    <br />
    <br />
    </form>
</asp:Content>
